/*
 * Copyright (c) 2010 Curtis Boyden.  All rights reserved. 
 * This software was developed by Curtis Boyden and is provided under the terms 
 * of the GNU Lesser General Public License, Version 2.1. You may not use 
 * this file except in compliance with the license. If you need a copy of the license, 
 * please go to http://www.gnu.org/licenses/lgpl-2.1.txt. The Original Code is ejMud
 * (Ewerp Java MUD).  The Initial Developer is Curtis Boyden.
 *
 * Software distributed under the GNU Lesser Public License is distributed on an "AS IS" 
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or  implied. Please refer to 
 * the license for the specific language governing your rights and limitations.
 */

package com.ewerp.mud.core.session;

import com.ewerp.mud.core.plugin.IPluginManager;
import com.ewerp.mud.messages.IMessage;

/**
 * An {@link ISession} encapsulates an entry point through which commands can
 * enter the ejMud engine.
 * 
 * Allows the {@link ISessionManager} to control (send notifications, shutdown,
 * etc...) the {@link ISession}s as a whole or individually.
 * 
 * @author cboyden
 * 
 */
public interface ISession {
    /**
     * Give the {@link ISession} access to the {@link IPluginManager}
     * 
     * @param pluginManager
     *            The {@link IPluginManager} to associate with this
     *            {@link ISession} <br />
     *            <ul>
     *            <li>{@link IPluginManager} : A valid plugin manager
     *            implementing {@link IPluginManager}</li>
     *            <li>null : Null is permitted. This will remove any existing
     *            association to an {@link IPluginManager}</li>
     *            </ul>
     */
    public void setPluginManager(IPluginManager pluginManager);

    /**
     * Used by the {@link ISessionManager} to shutdown an {@link ISession}.
     * Typically this will notify the connected client, terminate the connection and
     * free any session resources.
     */
    public void shutdown();
    
    public void processMessage(IMessage message);
}
